package com.project.forlearningdemo.dao;

import com.project.forlearningdemo.pojo.Comment;
import com.project.forlearningdemo.pojo.vo.StarNumPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface CommentMapper {
    //添加评论
    boolean saveComment(@Param("comment") Comment comment);
    //修改评论
    boolean updateComment(@Param("comment") Comment comment);
    //删除评论
    boolean deleteComment(@Param("commentId") Integer commentId);
    //查询评论
    List<Comment> selectComment(@Param("commentId") Integer commentId, @Param("resourceId") Integer resourceId);
    //统计某个资源下的所有评论
    StarNumPo queryStarNumPo(@Param("resourceId") Integer resourceId);
}
